//
//  GetTagDataRequest.m
//  Grammar
//
//  Created by Rick on 7/11/13.
//
//

#import "GetTagDataRequest.h"
#import "TagManager.h"
#import "Tag.h"

@implementation GetTagDataRequest
- (NSString*)getRequestUrl
{
    return [NSString stringWithFormat:@"%@%@",REQUEST_DOMAIN,@"grammar/getAllTags.intf?"];
}

- (ITTRequestMethod)getRequestMethod
{
    return ITTRequestMethodGet;
}

- (void)processResult
{
    for (NSDictionary *tagDic in [self.resultDic objectForKey:@"tags"]) {
        Tag *aTag = [[Tag alloc] initWithDataDic:tagDic];
        [[TagManager sharedManager] updateTag:aTag];
        [aTag release];
    }
    
}

@end
